{* original form template *}
<script type="text/javascript">
{literal}
function toggle_dates()
{
  var elem = document.getElementById('use_expiry');
  if( elem.checked == true )
  {
    document.getElementById('datefields').style.display = 'block';
  }
  else
  {
    document.getElementById('datefields').style.display = 'none';
  }
}
{/literal}
</script>

{if isset($error)}
  <h3><font color="red">{$error}</font></h3>
{else}
  {if isset($message)}
    <h3>{$message}</h3>
    <p>{$return_link}</p>
  {/if}
{/if}
{if !isset($message)}
{$startform}
	<div class="pageoverflow">
		<p class="pagetext">*{$titletext}:</p>
		<p class="pageinput">{$inputtitle}</p>
	</div>
	<div class="pageoverflow">
		<p class="pagetext">{$categorytext}:</p>
		<p class="pageinput">
                  {foreach from=$categorylist item='tmp' key='name'}
                    <input type="checkbox" name="{$actionid}cgblog_category_id[]" value="{$tmp.id}" {if $tmp.selected}checked="checked"{/if}>&nbsp;{$name}<br/>
                  {/foreach}
                </p>
	</div>
{if !isset($hide_summary_field) or $hide_summary_field == 0}
	<div class="pageoverflow">
		<p class="pagetext">{$summarytext}:</p>
		<p class="pageinput">{$inputsummary}</p>
	</div>
{/if}
{if isset($input_status)}
        <div class="pageoverflow">
		<p class="pagetext">{$prompt_status}:</p>
		<p class="pageinput">{$input_status}</p>
        </div>
{/if}
	<div class="pageoverflow">
		<p class="pagetext">*{$contenttext}:</p>
		<p class="pageinput">{$inputcontent}</p>
	</div>
	<div class="pageoverflow">
		<p class="pagetext">{$extratext}:</p>
		<p class="pageinput">{$inputextra}</p>
	</div>

        {if $fesubmit_useexpiry}
	<div class="pageoverflow">
		<p class="pagetext">{$CGBlog->Lang('useexpiration')}:</p>
		<p class="pageinput">
                  <input type="hidden" name="{$actionid}cgblog_usexpiry" value="0"/>
	          <input type="checkbox" id="use_expiry" name="{$actionid}cgblog_usexpiry" value="1" {if $use_expiry == 1}checked="checked"{/if} onclick="toggle_dates();"/>
                </p>
	</div>
        <div id="datefields" {if $use_expiry == 0}style="display: none;"{/if}>
	<div class="pageoverflow">
		<p class="pagetext">{$startdatetext}:</p>
		<p class="pageinput">{html_select_date prefix=$startdateprefix time=$startdate start_year='-10' end_year="+15"} {html_select_time prefix=$startdateprefix time=$startdate}</p>
	</div>
	<div class="pageoverflow">
		<p class="pagetext">{$enddatetext}:</p>
		<p class="pageinput">{html_select_date prefix=$enddateprefix time=$enddate start_year='-10' end_year="+15"} {html_select_time prefix=$enddateprefix time=$enddate}</p>
	</div>
        </div>
        {/if}

	{if isset($customfields)}
	   {foreach from=$customfields item='onefield'}
	      <div class="pageoverflow">
		<p class="pagetext">{$onefield->name}:</p>
		<p class="pageinput">{$onefield->field}</p>
	      </div>
	   {/foreach}
	{/if}
	<div class="pageoverflow">
		<p class="pagetext">&nbsp;</p>
		<p class="pageinput">{$hidden}{$submit}{$cancel}</p>
	</div>
{$endform}
{/if}
